{include file="public/header" /}
<body>
<div class="x-body layui-anim">
    <form class="layui-form" id="form" action="{:url('save')}">
        <input type="hidden" id="id" name="id" value="{$Request.param.id}">
        {include file="public/arguments" /}
        <div class="layui-form-item">
            <label class="layui-form-label">商品名称</label>
            <div class="layui-input-block">
                <input type="text" name="title" lay-verify="required" lay-reqtext="请填写商品名称" placeholder="请填写商品名称" class="layui-input" value="{$info?$info.title:''}"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">商品描述</label>
            <div class="layui-input-block">
                <input type="text" name="describe" lay-verify="required" lay-reqtext="请填写商品描述" placeholder="请填写商品描述" class="layui-input" value="{$info?$info.describe:''}"/>
            </div>
        </div>
        <div class="layui-form-item sunSelect" data-url="{:url('ProductCate/getCate')}" data-value="id" data-name="title">
            <label class="layui-form-label">所属专区</label>
            <div class="layui-input-inline">
                <select name="cate_1" data-name="商品专区" lay-verify="required" lay-reqtext="请选择商品专区" data-id="{$info?$info.cate_1:''}" lay-filter="sunSelect"></select>
            </div>
<!--            <div class="layui-input-inline">-->
<!--                <select name="cate_2" data-name="二级分类" lay-verify="required" lay-reqtext="请选择二级分类" data-id="{$info?$info.cate_2:''}" lay-filter="sunSelect"></select>-->
<!--            </div>-->
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">市场价</label>
            <div class="layui-input-inline">
                <input type="text" name="market_price"  lay-verify="required" lay-reqtext="请填写市场价格"
                       placeholder="请填写市场价格" class="layui-input" value="{$info?$info.market_price:''}"
                       onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
            </div>
            <div class="layui-form-mid layui-word-aux">元</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">会员价</label>
            <div class="layui-input-inline">
                <input type="text" name="price"  lay-verify="required" lay-reqtext="请填写会员价格" placeholder="请填写会员价格"
                       class="layui-input" value="{$info?$info.price:''}"
                       onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
            </div>
            <div class="layui-form-mid layui-word-aux">元</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">库存</label>
            <div class="layui-input-inline">
                <input type="text" name="stock" autocomplete="off" lay-verify="required" lay-reqtext="请填写商品库存" placeholder="请填写商品库存" class="layui-input"
                       value="{$info?$info.stock:''}" >
            </div>
        </div>

        <div class="layui-form-item ">
            <label class="layui-form-label">商品图片</label>
            <div class="layui-input-block">
                <div class="layui-tab-item layui-show" style="width: auto">
                    <input class="layui-upload-file" type="file" accept="" name="file">
                    <div class="layui-upload-drag uploadImages" inpName="images">
                        <i class="layui-icon"></i>
                        <p>点击上传，或将文件拖拽到此处</p>
                    </div>
                    <div id="uploadDemoView" style="">

                        <div class="showImages" >
                            {if isset($info)}
                                {foreach name="$info.images" id="v"}
                                <div class="imgContainer uploadImageBoxes" >
                                    <input type="hidden" name="images[]" value="{$v}" class="uploadInps"/>
                                    <img src="{$v}" alt="上传成功后渲染" style="max-width: 100%">
                                    <br/>
                                    <a href="javascript:;" class="uploadDels">删除</a>
                                </div>
                                {/foreach}
                            {/if}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-inline">
                <input type="text" name="sort" autocomplete="off" placeholder="请输入排序，越小越靠前" class="layui-input"
                       value="{$info?$info.sort:''}">
            </div>
        </div>

        <div class="layui-form-item ">
            <label class="layui-form-label">详情</label>
            <div class="layui-input-block">
                <script id="content" name="content" class="editor" style="width:100%;height:300px;" type="text/plain"><?php echo isset($info)?htmlspecialchars_decode($info['content']):'';?></script>
            </div>
        </div>

        <div class="layui-form-item" style="text-align: center;">
            <button class="layui-btn" lay-filter="save" lay-submit formObj="#form">保存</button>
        </div>

    </form>
</div>
</body>
{include file="public/footer" /}

</html>